package cn.org.donald.framework.pojo.vo;

import cn.org.donald.framework.pojo.BaseResult;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

/**
 * @author ： Donald
 * @date ： 2020/10/20 19:18
 * @description：
 */
@ApiModel(value = "TableResult集合分页专用对象",description = "restful风格响应返回体")
public class TableResult implements BaseResult {

    @ApiModelProperty(value = "http状态码")
    private Integer code;

    @ApiModelProperty(value = "响应提示")
    private String info;

    @ApiModelProperty(value = "http状态码")
    private Long timestamp;

    @ApiModelProperty(value = "总记录条数")
    private Long total;

    @ApiModelProperty(value = "当前返回记录条数")
    private Integer size;

    @ApiModelProperty(value = "当前页码")
    private Integer current;

    @ApiModelProperty(value = "返回记录数据")
    private Object rows;

    public TableResult() {
        this.code = 405;
        this.info = "请求失败";
        this.current = 1;
        this.size = 0;
        this.size = 0;

    }

    public TableResult(Long total, Integer size, Integer current, Object rows) {
        this.code = 200;
        this.info = "请求成功";
        this.timestamp = System.currentTimeMillis();
        this.total = total;
        this.current = current;
        this.size = size;
        this.rows = rows;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getInfo() {
        return info;
    }

    public void setInfo(String info) {
        this.info = info;
    }

    public Long getTimestamp() {
        return timestamp;
    }

    public void setTimestamp(Long timestamp) {
        this.timestamp = timestamp;
    }

    public Long getTotal() {
        return total;
    }

    public void setTotal(Long total) {
        this.total = total;
    }

    public Integer getSize() {
        return size;
    }

    public void setSize(Integer size) {
        this.size = size;
    }

    public Integer getCurrent() {
        return current;
    }

    public void setCurrent(Integer current) {
        this.current = current;
    }

    public Object getRows() {
        return rows;
    }

    public void setRows(Object rows) {
        this.rows = rows;
    }
}
